{extend name="$_tpl_public_layout_danceadmin"/}


{block name="breadcrumb"}
<ol class="breadcrumb">
	<li class="breadcrumb-item"><a href="{:url('admin/index/index')}">{:config('system.site_title')}</a></li>
	<li class="breadcrumb-item"><a href="{:url('admin/adminUser/index')}">{$sideName}</a></li>
</ol>
{/block}


{block name="pageheader"}
{$sideName}
{/block}


{block name="content"}
<!-- 搜索框 -->
<div class="card mb-3">
	<div class="card-body">
		<form method="get" action="" class="J_ajaxForm">
			<div class="form-row mb-1">
				<div class="col-md-3">
					<div class="input-group">
						<div class="input-group-prepend">
							<div class="input-group-text">id</div>
						</div>
						<input type="text" name="id" value="{$id}" class="form-control" />
					</div>
				</div>
				<div class="col-md-3">
					<div class="input-group">
						<div class="input-group-prepend">
							<div class="input-group-text">用户名</div>
						</div>
						<input type="text" name="username" value="{$username}" class="form-control" />
					</div>
				</div>
				<div class="col-md-3">
					<div class="input-group">
						<div class="input-group-prepend">
							<div class="input-group-text">用户组</div>
						</div>
						<select name="groupid" class="form-control">
							<option value="0">全部</option>
							{volist name="groupList" id="vo"}
								<?php
									$selected = $groupid == $key ? 'selected' : '';
								?>
								<option value="{$key}" {$selected}>{$vo['name']}</option>
							{/volist}
						</select>
					</div>
				</div>
			</div>
			<div class="form-row mb-1">
				<div class="col-md-3">
					<div class="input-group">
						<div class="input-group-prepend">
							<div class="input-group-text">姓名</div>
						</div>
						<input type="text" name="realname" value="{$realname}" class="form-control" />
					</div>
				</div>
				<div class="col-md-3">
					<div class="input-group">
						<div class="input-group-prepend">
							<div class="input-group-text">手机号</div>
						</div>
						<input type="text" name="mobile" value="{$mobile}" class="form-control" />
					</div>
				</div>
				<div class="col-md-3">
					<div class="input-group">
						<div class="input-group-prepend">
							<div class="input-group-text">备注</div>
						</div>
						<input type="text" name="remark" value="{$remark}" class="form-control" />
					</div>
				</div>
			</div>
			<div>
				<button type="submit" data-action="{:url('admin/adminUser/index')}" class="btn btn-success btn-sm J_excel">搜索</button>
			</div>
		</form>
	</div>
</div>
<!-- 搜索框 END -->

<div class="card">
	<div class="card-body">
		<div class="dataTable-toolbar">
			<a href="{:url('admin/adminUser/add')}" class="btn btn-primary btn-sm dataTable-add">添加</a>
		</div>
		<form class="">
			<table class="table table-striped table-bordered table-hover dataTable-table">
				<thead>
					<tr>
						<th width="76">ID</th>
						<th>用户信息</th>
						<th width="120">用户组别</th>
						<th width="146">创建时间</th>
						<th width="146">最后登陆</th>
						<th width="80">状态</th>
						<th width="120">操作</th>
					</tr>
				</thead>
				<tbody>
					{volist name="list" id="vo"}
					<tr>
						<td>{$vo['id']}</td>
						<td>
							<div class="daui-media daui-media_appmsg daui-media_user border-dotted-success">
								<div class="daui-media__hd">
									<img class="daui-media__thumb" src="{$vo['avatar']}" onerror="Javascript:this.src='/themes/public/images/noimg.gif';" />
								</div>
								<div class="daui-media__bd">
									<div class="daui-media__name">{$vo['username']}(uid:{$vo['id']})</div>
									<div class="daui-media__work">姓名：{$vo['realname']}</div>
									<div class="daui-media__work">手机号：{$vo['mobile']}</div>
									<div class="daui-media__work">备注：{$vo['remark']}</div>
									{if condition="$vo['openidmpweixin']"}
									<div class="daui-media__work text-green">小程序微信授权</div>
									{else /}
									<div class="daui-media__work text-green">小程序微信(未授权)</div>
									{/if}
								</div>
							</div>
						</td>
						<td>{$groupList[$vo['groupid']]['name']}</td>
						<td>{$vo['create_time_show']}</td>
						<td>{$vo['create_time_show']}</td>
						<td>{$user_state_config[$vo['state']]}</td>
						<td>
							<a href="{:url('admin/adminUser/add', ['id'=>$vo['id']])}" class="btn btn-primary btn-xs dataTable-add">编辑</a>
							<a href="{:url('admin/adminUser/doDelete', ['id'=>$vo['id']])}" class="btn btn-danger btn-xs dataTable-delete J_layerConfirm" data-tip="您确定要执行删除操作吗？">删除</a>
						</td>
					</tr>
					{/volist}
				</tbody>
			</table> 
		</form>
		<div class="dataTable-pages">{$pageShow|raw}</div>
	</div>
</div>
{/block}